package com.yowasa.xiuxian.engine.battle.enemy.strategy;

import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.BS;
import com.yowasa.xiuxian.engine.battle.strategy.BaseSpellStrategy;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.BuffContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.service.helper.BattleHelper;
import com.yowasa.xiuxian.util.RandomUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@BS(name = "天陨的启视")
@Order(100)
@Component
public class TianYunQiShi extends BaseSpellStrategy {
    @Autowired
    private BattleHelper battleHelper;

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void action(UserBattleContent first, UserBattleContent second, BattleContent content) {
        BuffContent checkBuff = second.getBuff().get("深渊凝视");
        if(checkBuff != null && (checkBuff.getDuration() !=0 || checkBuff.getNum()!=0)){
            second.getBattleInfo().setChp(second.getBattleInfo().getChp() - 1000);
            content.getMsgLog().add("深渊的凝视传来极大的恶意，"+second.getUserBO().getName() + "失去了1000点hp");
        }
        BuffContent buffContent = new BuffContent();
        buffContent.setDuration(5);
        buffContent.setNum(1);
        second.getBuff().put("深渊凝视", buffContent);
        first.getCd().put("天陨的启视", 8);
        content.getMsgLog().add("深渊开始注意到你，向你投下凝视的目光");
    }

    @Override
    public void limit(UserBO user) {}

    @Override
    public String limitDesc() {
        return "无";
    }

    @Override
    public String desc() {
        return "天陨的启视，深渊象征着不详与毁灭，深渊使徒唤来深渊的凝视\n为你附上一层印记，在五回合后消失，造成1000点固定伤害\n当buff存在时再次释放，会直接引爆该效果";
    }

    @Override
    public boolean check(UserBattleContent user, BattleContent content) {
        Integer cd = user.getCd().get("天陨的启视");
        if (cd != null && cd > 0) {
            return false;
        }
        return true;
    }


}
